#!/usr/bin/env bash -e

echo "Starting environment check..."

echo "NODE_ENV: $NODE_ENV"

echo "node --version"
node --version

echo "gulp --version"
gulp --version

echo "yarn --version"
yarn --version

# install node-sass binary from TaobaoNPM instead of default https://github.com/sass/node-sass
# may improve installing performance dramatically
export SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/

yarn install --production

# relies on NODE_ENV
NODE_ENV="$NODE_ENV" npm run build
tar -czvf "$TAR_NAME" dist/
